package com.zuo.entity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @Author 白白旧维
 * @Date 2022/2/28 18:33
 */
public class Department {

    private int did;
    private String dname;
    private String ddetail;
    private List<Staff> staffList;

    public Department() {
        this.staffList = new ArrayList<>();
    }

    public Department(int did, String dname, String ddetail, List<Staff> staffList) {
        this.did = did;
        this.dname = dname;
        this.ddetail = ddetail;
        this.staffList = staffList;
    }

    public int getDid() {
        return did;
    }

    public void setDid(int did) {
        this.did = did;
    }

    public String getDname() {
        return dname;
    }

    public void setDname(String dname) {
        this.dname = dname;
    }

    public String getDdetail() {
        return ddetail;
    }

    public void setDdetail(String ddetail) {
        this.ddetail = ddetail;
    }

    public List<Staff> getStaffList() {
        return staffList;
    }

    public void setStaffList(List<Staff> staffList) {
        this.staffList = staffList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Department that = (Department) o;
        return did == that.did &&
                Objects.equals(dname, that.dname) &&
                Objects.equals(ddetail, that.ddetail) &&
                Objects.equals(staffList, that.staffList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(did, dname, ddetail, staffList);
    }

    @Override
    public String toString() {
        return "Department{" +
                "did=" + did +
                ", dname='" + dname + '\'' +
                ", ddetail='" + ddetail + '\'' +
                ", staffList=" + staffList +
                '}';
    }
}
